package com.henry.veterinary;

import java.util.Objects;

public class Animal {
    // 动物编号，主人编号，名字，类型，年龄，性别
    private String ID;
    private String ownerID;
    private String name;
    private String type;
    private String age;
    private String sex;

    public Animal(String ID, String ownerID, String name, String type, String age, String sex) {
        this.ID = ID;
        this.ownerID = ownerID;
        this.name = name;
        this.type = type;
        this.age = age;
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "ID='" + ID + '\'' +
                ", ownerID='" + ownerID + '\'' +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", age='" + age + '\'' +
                ", sex='" + sex + '\'' +
                '}';
    }

    public String getID() {
        return ID;
    }

    public String getOwnerID() {
        return ownerID;
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public String getAge() {
        return age;
    }

    public String getSex() {
        return sex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Animal animal = (Animal) o;
        return Objects.equals(ID, animal.ID);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ID);
    }
}
